﻿using System;
using System.Configuration;

namespace FBGraph.Configuration
{
    /// <summary>Configures FBGraph applications that will be used by the client framework to make FBGraph API requests.</summary>
    public class FBGraphApplicationElement : ConfigurationElement
    {
        /// <summary>Gets or sets an optional environment value that specifies which development environment the configured application should be used for.</summary>
        /// <remarks>This property is only used for desktop applications, and is ignored for website applications.</remarks>
        [ConfigurationProperty("environment", IsKey = true, IsRequired = false, DefaultValue = null)]
        public String Environment
        {
            get { return (String)this["environment"]; }
            set { this["environment"] = value; }
        }

        /// <summary>Gets or sets the client ID for the application that is supplied by FBGraph.</summary>
        [ConfigurationProperty("clientID", IsKey = true, IsRequired = true)]
        public Int64 ClientID
        {
            get { return (Int64)this["clientID"]; }
            set { this["clientID"] = value; }
        }

        /// <summary>Gets or sets the client secret for the application that is supplied by FBGraph.</summary>
        [ConfigurationProperty("clientSecret", IsRequired = true)]
        public String ClientSecret
        {
            get { return (String)this["clientSecret"]; }
            set { this["clientSecret"] = value; }
        }

        /// <summary>Gets or sets the name of the Preload FQL configuration.</summary>
        [ConfigurationProperty("preloadFqlParam", IsRequired = false, DefaultValue = null)]
        public String PreloadFqlParam
        {
            get { return (String)this["preloadFqlParam"]; }
            set { this["preloadFqlParam"] = value; }
        }
    }
}